import Vue from 'vue'
import App from './App'
import uView from 'uview-ui'
import Vant from 'vant'
import 'vant/lib/index.css'
import vuedraggable from 'vuedraggable'
import httpRequest from './utils/httpRequest' // api: https://github.com/axios/axios;
import httploadingRequest from './utils/httploadingRequest' // api: https://github.com/axios/axios;
import httpCmsRequest from './utils/httpCmsRequest'

import { isAuth } from 'utils'
import router from 'vue-router'                 // api: https://github.com/vuejs/vue-router
import store from 'store'                   // api: https://github.com/vuejs/vuex
import VueCookie from 'vue-cookie'            // api: https://github.com/alfhen/vue-cookie
import { Dialog } from 'vant'
/* 引入公共js*/
import dict from './utils/dict'
import cache from './utils/cache'
import util from './utils/validate'
import common from './utils/common'
import config from './utils/config'
/* 引入蓝信jssdk */
import lx from './utils/lanxin'
import VConsole from 'vconsole'

// const vConsole = new VConsole()

Vue.config.productionTip = false
Vue.use(uView);
Vue.use(Vant);
Vue.use(vuedraggable);
Vue.use(router);
Vue.use(store);
Vue.use(VueCookie);
Vue.use(Dialog);
App.mpType = 'app'

// 挂载全局
Vue.prototype.$http = httpRequest // ajax请求方法
Vue.prototype.$httpCms = httpCmsRequest
Vue.prototype.$httploading = httploadingRequest // ajax请求方法
Vue.prototype.isAuth = isAuth     // 权限方法
Vue.prototype.dict=dict; //全局获取字典相关方法
Vue.prototype.cache=cache;//全局缓存l
Vue.prototype.util=util;//全局工具类
Vue.prototype.common=common;//全局工具类
Vue.prototype.lx=lx;//蓝信lx
Vue.prototype.configUtil=config;//配置类

//执行完onLaunch后再执行页面onLoad
Vue.prototype.$onLaunched = new Promise(resolve => {
    Vue.prototype.$isResolve = resolve
})
//增加mock测试
// require('@/mock')

const app = new Vue({
    ...App,
    router,
    store,
})
app.$mount()
